################################################################################
## MOD Title:		Second Profilepage button in the viewtopic - Version 1
## MOD Author:		AmigaLink < webmaster@amigalink.de > (Markus Schmidt) http://www.EssenMitFreude.info
## 
## MOD Description:	Display a button in viewtopic if poster has a second profilepage.
## 
## Installation Level:	easy
## Installation Time:	3 Minutes 
##
## Files To Edit:  	3
##			viewtopic.php
##
##			templates/subSilver/viewtopic_body.tpl
##			templates/subSilver/subSilver.cfg
##
## Included Files:	2
##
##			templates/subSilver/images/lang_english/icon_extra.gif
##			templates/subSilver/images/lang_german/icon_extra.gif
##
################################################################################
## The following sites also contain the latest version of this MOD: 
## 
## http://www.AmigaLink.de
## 
## Full support for this MOD can be obtained at: 
##
## http://www.AmigaLink.de
##  
################################################################################
## Mod Notes:
##
##	This is a goodie for the easyUCP extension - Second Profilepage.
##	You must install that MODs first!
##
################################################################################
## MOD History: 
## 
##   2006-04-26 - Version 1.0.1
##	- little change to solve a problem at some boards
##
##   2006-03-07 - Version 1.0.0
##	- First Version
## 
################################################################################
##
##  This hack is released under the GPL License. 
##  This hack can be freely used, but not distributed, without permission.
##  Intellectual Property Rights are retained by the hack author(s) 
##  listed above.
##
################################################################################
##
##  BEFORE ADDING THIS HACK TO YOUR FORUM, please be sure to backup ALL
##  affected files.
##
################################################################################ 
#
#----------[ COPY FILES ]-------------------------------
#
#  Copy / upload the following files to your phpBB root directory.
#  The phpBB root directory is the directory on your server containing index.php
#

templates/subSilver/images/lang_english/icon_extra.gif to templates/subSilver/images/lang_english/icon_extra.gif
templates/subSilver/images/lang_german/icon_extra.gif to templates/subSilver/images/lang_german/icon_extra.gif

#
#----------[ OPEN ]-------------------------------------
#

templates/subSilver/subSilver.cfg

#
#----------[ FIND ]-------------------------------------
#

$images['icon_second_profile'] = "$current_template_images/icon_second_profile.gif";

#
#----------[ AFTER, ADD ]-------------------------------
#

$images['icon_extra'] = "$current_template_images/{LANG}/icon_extra.gif";

#
#----------[ OPEN ]-------------------------------------
#

templates/subSilver/viewtopic_body.tpl

#
#----------[ FIND ]-------------------------------------
#

				<td valign="middle" nowrap="nowrap">{postrow.PROFILE_IMG} {postrow.PM_IMG} {postrow.EMAIL_IMG} {postrow.WWW_IMG} {postrow.AIM_IMG} {postrow.YIM_IMG} {postrow.MSN_IMG}<script language="JavaScript" type="text/javascript"><!--

#
#----------[ INLINE FIND ]------------------------------
#

{postrow.PROFILE_IMG}

#
#----------[ INLINE AFTER, ADD ]------------------------
#

 {postrow.EXTRA_IMG}

#
#----------[ OPEN ]-------------------------------------
#

viewtopic.php

#
#----------[ FIND ]-------------------------------------
#

$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_lang, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid,

#
#----------[ INLINE FIND ]------------------------------
#

u.user_allow_viewonline

#
#----------[ INLINE AFTER, ADD ]------------------------
#

, u.user_allow_viewprofile_2

#
#----------[ FIND ]-------------------------------------
#

		$profile = '<a href="' . $temp_url . '">' . $lang['Read_profile'] . '</a>';

#
#----------[ AFTER, ADD ]-------------------------------
#

// <!-- BEGIN easyUCP -->
		$second_page_allowed = false;
		if ( $postrow[$i]['user_allow_viewprofile_2'] != '-2' )
		{
			if ( $postrow[$i]['user_allow_viewprofile_2'] == ANONYMOUS || $userdata['user_level'] == ADMIN )  // Gste
			{
				$second_page_allowed = true;
			}
			else if ( $userdata['session_logged_in'] && $row['user_allow_viewprofile_2'] == USER || $userdata['user_level'] == MOD )  // User
			{
				$second_page_allowed = true;
			}
			else
			{
				$second_page_allowed = false;
			}
		}
		if ( $second_page_allowed )
		{
			$temp_url = append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=$poster_id&amp;page=2");
			$second_profile_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_extra'] . '" alt="' . $lang['Second_profilepage'] . '" title="' . $lang['Second_profilepage'] . '" border="0" /></a>';
			$second_profile = '<a href="' . $temp_url . '">' . $lang['Second_profilepage'] . '</a>';
		}
		else
		{
			$second_profile_img = '';
			$second_profile = '';
		}
// <!-- END easyUCP -->

#
#----------[ FIND ]-------------------------------------
#

		$profile_img = '';
		$profile = '';

#
#----------[ AFTER, ADD ]-------------------------------
#

		$second_profile_img = '';
		$second_profile = '';

#
#----------[ FIND ]-------------------------------------
#

		'PROFILE' => $profile,

#
#----------[ AFTER, ADD ]-------------------------------
#

		'EXTRA_IMG' => $second_profile_img,
		'EXTRA' => $second_profile,

#
#----------[ SAVE AND CLOSE ALL FILES ]-----------------
#
# EoM